package org.springframework.zp.transaction.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Component
public class PropagationUserService2 {

	@Autowired
	JdbcTemplate jdbcTemplate;


	@Transactional(propagation = Propagation.MANDATORY)
	public void update(){
		jdbcTemplate.update("update t set name=? where id=?","n2","4");
		 int i = 1 / 0;
	}
}
